setTimeout(function () {
  console.log('setTimeout1')
  new Promise(function (resolve) {
    resolve()
  }).then(function () {
    new Promise(function (resolve) {
      resolve()
    }).then(function () {
      console.log('then4')
    })
    console.log('then2')
  })
})

new Promise(function (resolve) {
  console.log('promise1')
  resolve()
}).then(function () {
  console.log('then1')
})

setTimeout(function () {
  console.log('setTimeout2')
})

queueMicrotask(() => {
  console.log('xxx')
})

console.log(2)

new Promise(function (resolve) {
  resolve()
}).then(function () {
  console.log('then3')
})

// promise1  2  then1  then3   setTimeout1  then2  setTimeout2  then4
// 微任务 有哪些  ??? then

// vue中事件的回调会加入微任务 比如:生命周期,watch,组件更新
